/*
 * @Description: 
 * @Author: changqing
 * @Date: 2021-08-29 22:06:15
 * @LastEditTime: 2021-08-29 22:10:11
 * @LastEditors: changqing
 * @Usage: 
 */
var { merge,of,timer, interval } = require('rxjs');
var { map} = require('rxjs/operators');
const sourceA = interval(1000).pipe(map((data) => `A${++data}`));

const sourceB = interval(3000).pipe(map((data) => `B${++data}`));

const sourceC = interval(5000).pipe(map((data) => `C${++data}`));

merge(sourceA, sourceB, sourceC).subscribe((data) => {
console.log(`merge 示例 ${data}`);
});
// merge 示例 A1
// merge 示例 A2
// merge 示例 A3 (A3, B1 会同时发生)
// merge 示例 B1
// merge 示例 A4
// merge 示例 A5 (A5, C1 会同时发生)
// merge 示例 C1
// merge 示例 A6 (A6, B2 会同时发生)
// merge 示例 B2